/*
 * Copyright 2010 Mark Eschbach.
 *
 * $HeadURL$
 * $Id$
 */
package com.meschbach.cise.resource.jar;

import com.meschbach.cise.iterator.IteratorFactory;
import com.meschbach.cise.iterator.MIterator;
import java.io.IOException;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;

/**
 *
 * @author "Mark Eschbach" &lt;meschbach@gmail.com&gt;
 */
public class JarEntryIteratorFactory implements IteratorFactory<JarEntry, IOException> {

    JarSource source;

    public JarEntryIteratorFactory(JarSource source) {
        this.source = source;
    }

    public MIterator<JarEntry, IOException> buildIterator() throws IOException {
        JarInputStream input = source.getSource();
        return new JarEntryIterator(input);
    }
}
